package com.ruoyi.bl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bl.mapper.BlGoodsCategoryMapper;
import com.ruoyi.bl.domain.BlGoodsCategory;
import com.ruoyi.bl.service.IBlGoodsCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-01
 */
@Service
public class BlGoodsCategoryServiceImpl implements IBlGoodsCategoryService 
{
    @Autowired
    private BlGoodsCategoryMapper blGoodsCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param categoryId 商品分类主键
     * @return 商品分类
     */
    @Override
    public BlGoodsCategory selectBlGoodsCategoryByCategoryId(Long categoryId)
    {
        return blGoodsCategoryMapper.selectBlGoodsCategoryByCategoryId(categoryId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param blGoodsCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<BlGoodsCategory> selectBlGoodsCategoryList(BlGoodsCategory blGoodsCategory)
    {
        return blGoodsCategoryMapper.selectBlGoodsCategoryList(blGoodsCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param blGoodsCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertBlGoodsCategory(BlGoodsCategory blGoodsCategory)
    {
        blGoodsCategory.setCreateTime(DateUtils.getNowDate());
        return blGoodsCategoryMapper.insertBlGoodsCategory(blGoodsCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param blGoodsCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateBlGoodsCategory(BlGoodsCategory blGoodsCategory)
    {
        blGoodsCategory.setUpdateTime(DateUtils.getNowDate());
        return blGoodsCategoryMapper.updateBlGoodsCategory(blGoodsCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param categoryIds 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteBlGoodsCategoryByCategoryIds(Long[] categoryIds)
    {
        return blGoodsCategoryMapper.deleteBlGoodsCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除商品分类信息
     * 
     * @param categoryId 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteBlGoodsCategoryByCategoryId(Long categoryId)
    {
        return blGoodsCategoryMapper.deleteBlGoodsCategoryByCategoryId(categoryId);
    }
}
